home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 25 / CU Amiga Magazine's Super CD-ROM 25 (1998)(EMAP Images)(GB)(Track 1 of 2)[!][issue 1998-08].iso / CUCD / Programming / ixemul / sdk / man / cat5 / utmp.0 < prev   
Encoding:
Text File  |  1998-06-15  |  3.9 KB  |  86 lines

  1.  
  2. UTMP(5)                    UNIX Programmer's Manual                    UTMP(5)
  3.  
  4. NNAAMMEE
  5.      uuttmmpp, wwttmmpp, llaassttlloogg - login records
  6.  
  7. SSYYNNOOPPSSIISS
  8.      ##iinncclluuddee <<uuttmmpp..hh>>
  9.  
  10. DDEESSCCRRIIPPTTIIOONN
  11.      The file <_u_t_m_p_._h> declares the structures used to record information
  12.      about current users in the file uuttmmpp, logins and logouts in the file
  13.      wwttmmpp, and last logins in the file llaassttlloogg. The time stamps of date
  14.      changes, shutdowns and reboots are also logged in the wwttmmpp file.
  15.  
  16.      These files can grow rapidly on busy systems, daily or weekly rotation is
  17.      recommended.  If any of these files do not exist, it is not created.
  18.      These files must be created manually and are normally maintained in ei-
  19.      ther the script _/_e_t_c_/_d_a_i_l_y or the script _/_e_t_c_/_w_e_e_k_l_y. (See cron(8).)
  20.  
  21.            #define _PATH_UTMP      "/var/run/utmp"
  22.            #define _PATH_WTMP      "/var/log/wtmp"
  23.            #define _PATH_LASTLOG   "/var/log/lastlog"
  24.  
  25.            #define UT_NAMESIZE     8
  26.            #define UT_LINESIZE     8
  27.            #define UT_HOSTSIZE     16
  28.  
  29.            struct lastlog {
  30.                    time_t  ll_time;
  31.                    char    ll_line[UT_LINESIZE];
  32.                    char    ll_host[UT_HOSTSIZE];
  33.            };
  34.  
  35.            struct utmp {
  36.                    char    ut_line[UT_LINESIZE];
  37.                    char    ut_name[UT_NAMESIZE];
  38.                    char    ut_host[UT_HOSTSIZE];
  39.                    time_t  ut_time;
  40.            };
  41.  
  42.      Each time a user logs in, the login program looks up the user's UID in
  43.      the file llaassttlloogg.. If it is found, the timestamp of the last time the user
  44.      logged in, the terminal line and the hostname are written to the standard
  45.      output. (Providing the login is not _q_u_i_e_t, see login(1).)  The login pro-
  46.      gram then records the new login time in the file llaassttlloogg.
  47.  
  48.      After the new _l_a_s_t_l_o_g record is written , the file uuttmmpp is opened and the
  49.      _u_t_m_p record for the user inserted.  This record remains there until the
  50.      user logs out at which time it is deleted.  The uuttmmpp file is used by the
  51.      programs rwho(1),  users(1),  w(1),  and who(1).
  52.  
  53.      Next, the login program opens the file wwttmmpp, and appends the user's _u_t_m_p
  54.      record.  The same _u_t_m_p record, with an updated time stamp is later ap-
  55.      pended to the file when the user logs out. (See init(8).)  The wwttmmpp file
  56.      is used by the programs last(1) and ac(8).
  57.  
  58.      In the event of a date change, a shutdown or reboot, the following items
  59.      are logged in the wwttmmpp file.
  60.  
  61.      reboot
  62.      shutdown    A system reboot or shutdown has been initiated.  The charac-
  63.                  ter `~' is placed in the field _u_t___l_i_n_e, and reboot or
  64.                  shutdown in the field _u_t___n_a_m_e. (See shutdown(8) and
  65.                  reboot(8).)
  66.  
  67.      date        The system time has been manually or automatically updated.
  68.                  (See date(1).)  The command name date is recorded in the
  69.                  field _u_t___n_a_m_e. In the field _u_t___l_i_n_e, the character `|' indi-
  70.                  cates the time prior to the change, and the character `{' in-
  71.                  dicates the new time.
  72.  
  73. FFIILLEESS
  74.      /var/run/utmp     The uuttmmpp ffiillee..
  75.      /var/log/wtmp     The wwttmmpp ffiillee..
  76.      /var/log/lastlog  The llaassttlloogg ffiillee..
  77.  
  78. SSEEEE AALLSSOO
  79.      last(1),  login(1),  who(1),  ac(8),  init(8)
  80.  
  81. HHIISSTTOORRYY
  82.      A uuttmmpp and wwttmmpp file format appeared in Version 6 AT&T UNIX.  The llaassttlloogg
  83.      file format appeared in 3.0BSD.
  84.  
  85. 4th Berkeley Distribution       March 17, 1994                               2
  86.